﻿<Fluent:RibbonWindow
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
        xmlns:vm="clr-namespace:NicoView.ViewModel"
        xmlns:local="clr-namespace:NicoView.View" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:NicoView="clr-namespace:NicoView"
        xmlns:Behaviors="clr-namespace:NicoView.View.Behaviors"
        xmlns:view="clr-namespace:NicoView.View"
        xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" x:Name="MainNicoViewWindow" x:Class="NicoView.View.MainWindow"
        Title="{Binding Title, Mode=OneWay}" 
        
        DataContext="{Binding Main, Mode=OneWay, Source={StaticResource locator}}"  IsEnabled="{Binding IsEnabled, Mode=OneWay}" Topmost="{Binding Topmost, Source={StaticResource settings}}" Height="{Binding MainWindowHeight, Source={StaticResource settings}}" Width="{Binding MainWindowWidth, Source={StaticResource settings}}" Closed="MainNicoViewWindow_Closed"
        
        >

    <Fluent:RibbonWindow.Style>
        <Style TargetType="{x:Type Fluent:RibbonWindow}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsEnabled, Mode=OneWay}" Value="false"  >
                    <Setter Property="Cursor" Value="AppStarting"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Fluent:RibbonWindow.Style>


    <i:Interaction.Triggers>
        <Behaviors:BouyomichanPathSetRequestTrigger>
            <Behaviors:ShowBouyomichanPathSetRequestAction/>
        </Behaviors:BouyomichanPathSetRequestTrigger>

        <Behaviors:NotificationMessageTrigger>
            <Behaviors:NotificationAction   />
        </Behaviors:NotificationMessageTrigger>


        <Behaviors:NicoViewIdInputConnectionExecuteMessageTrigger>
            <Behaviors:MouseCursorChangeAction TargetCursor="Wait" />
            <Behaviors:NotificationAction/>
        </Behaviors:NicoViewIdInputConnectionExecuteMessageTrigger>

        <Behaviors:NicoViewIdInputConnectionExecutedMessageTrigger>
            <Behaviors:MouseCursorChangeAction TargetCursor="Arrow"/>
            <Behaviors:NotificationAction/>
        </Behaviors:NicoViewIdInputConnectionExecutedMessageTrigger>

        <Behaviors:NicoViewConnectionFailedMessageTrigger>
            <Behaviors:MouseCursorChangeAction TargetCursor="Arrow"/>
            <Behaviors:PlayHandSystemSoundAction />
            <Behaviors:NicoViewNotificationShowWindowAction />
        </Behaviors:NicoViewConnectionFailedMessageTrigger>

        <Behaviors:NicoViewResultShowMessageTrigger>
            <Behaviors:NicoViewNotificationShowWindowAction />
        </Behaviors:NicoViewResultShowMessageTrigger>

        <Behaviors:NicoViewAlertMessageTrigger>
            <Behaviors:PlayHandSystemSoundAction />
            <Behaviors:NicoViewNotificationShowWindowAction />
        </Behaviors:NicoViewAlertMessageTrigger>

        <Behaviors:ShowUserInfoCommentsMessageTrigger>
            <Behaviors:ShowUserInfoCommentsAction/>
        </Behaviors:ShowUserInfoCommentsMessageTrigger>

        <Behaviors:ShowBroadcastConsolMessageTrigger>
            <Behaviors:ShowBroadcastConsolWindowAction  />
        </Behaviors:ShowBroadcastConsolMessageTrigger>

        <Behaviors:NicoVideoConsoleEventArgsTrigger>
            <Behaviors:NicoVideoConsoleShowWindowAction/>
        </Behaviors:NicoVideoConsoleEventArgsTrigger>

        <Behaviors:CommentShowCommentMessageTrigger>
            <Behaviors:CommentShowAction />
        </Behaviors:CommentShowCommentMessageTrigger>

        <Behaviors:SetAuthMessageTrigger>
            <Behaviors:SetAuthAction />
        </Behaviors:SetAuthMessageTrigger>
        <i:EventTrigger EventName="Loaded">
            <i:InvokeCommandAction Command="{Binding LoadCommand}"  />
        </i:EventTrigger>
        
        
        
        <!--放送トリガー系 -->

        <Behaviors:BroadcastStartFailedMessageTrigger>
            <Behaviors:PlayHandSystemSoundAction/>
            <Behaviors:NicoViewNotificationShowWindowAction/>
        </Behaviors:BroadcastStartFailedMessageTrigger>

        <Behaviors:BroadcastStartedMessageTrigger>
            <Behaviors:NotificationAction/>
        </Behaviors:BroadcastStartedMessageTrigger>

        <Behaviors:BroadcastStartingMessageTrigger>
            <Behaviors:NotificationAction/>
        </Behaviors:BroadcastStartingMessageTrigger>

        <Behaviors:BroadcastQueueingMessageTrigger>
            <Behaviors:NotificationAction/>
        </Behaviors:BroadcastQueueingMessageTrigger>
    </i:Interaction.Triggers>


    <DockPanel>
		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="VisualStateGroup"/>
		</VisualStateManager.VisualStateGroups>

		<local:NicoViewRibbonControl x:Name="RibbonControl" DockPanel.Dock="Top"  />
		<Grid DockPanel.Dock="Top" >
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			<local:NicoViewCommentViewFlameControl x:Name="CommentViewFrameControl" Grid.Row="0" />

			<DockPanel Grid.Row="2">
				<StatusBar x:Name="NicoViewStatusBar" DockPanel.Dock="Bottom"  FontSize="12" DataContext="{Binding NicoViewServiceViewModel, Mode=OneWay, Source={StaticResource locator}}" >
					<StatusBarItem  x:Name="NotifyStatus"  />
					<Separator DockPanel.Dock="Left" />
					<StatusBarItem Content="{Binding Time, Mode=OneWay, Source={StaticResource resources}}" />
					<StatusBarItem Content=":"/>
					<StatusBarItem Content="{Binding ServiceElapsedTime}"/>
					<StatusBarItem Content="{Binding VisitorCount, Mode=OneWay, Source={StaticResource resources}}"/>
					<StatusBarItem Content=":"/>
					<StatusBarItem Content="{Binding WatchCount}"/>
					<StatusBarItem Content="("/>
					<StatusBarItem Content="{Binding Active, Mode=OneWay, Source={StaticResource resources}}" />
					<StatusBarItem Content=":"/>
					<StatusBarItem Content="{Binding ActiveWatchCount}"/>
					<StatusBarItem Content=")"/>
					<StatusBarItem Content="{Binding CommentCount, Mode=OneWay, Source={StaticResource resources}}"/>
					<StatusBarItem Content=":"/>
					<StatusBarItem Content="{Binding CommentCount}"/>


					<StatusBarItem  DockPanel.Dock="Right"   DataContext="{Binding SelfUserViewModel, Mode=OneWay, Source={StaticResource locator}}">
						<TextBlock  VerticalAlignment="Center" ><Run Text="{Binding LoginUser, Mode=OneWay, Source={StaticResource resources}}" /><Run Text=" "/><Run Text=":"/><Run Text=" "/><Run Text="{Binding NickName, Mode=OneWay}"  /></TextBlock>
					</StatusBarItem>
					<Separator DockPanel.Dock="Right" />
                    
                    
                    
                    




				</StatusBar>
			</DockPanel>
            

		</Grid>
	</DockPanel>    


    
</Fluent:RibbonWindow>
